class MessageModel {
  final int id; // id
  final String title; // 消息标题
  final String content; // 消息内容
  final String sender; // 发送者
  final String avatar; // 头像URL
  final String time; // 时间
  final String period; // 时间段(AM/PM)
  final bool hasNew; // 是否有新消息

  MessageModel({
    required this.id,
    required this.title,
    required this.content,
    required this.sender,
    required this.avatar,
    required this.time,
    required this.period,
    this.hasNew = false,
  });

  // 创建测试数据列表
  static List<MessageModel> get testData => List.generate(
        20,
        (index) => MessageModel(
          id: 0,
          title: '上传了一段新录音',
          content: '"快去听取最新录音故事吧！"',
          sender: '奶奶',
          avatar: 'https://placehold.co/22x22',
          time: '07:00',
          period: 'AM',
          hasNew: index < 3, // 前3条显示为新消息
        ),
      );
}
